package cn.com.huzo.repository.trade.impl;

import cn.com.huzo.model.entities.trade.ProductionInstructionLinesSuitStyleNoEntity;
import cn.com.huzo.repository.trade.ProductionInstructionLinesSuitStyleNoRepository;
import huzofw.repository.impl.GenericRepositoryImpl;
import huzofw.repository.impl.MyBatisDaoUtils;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Repository;

/**
 * 生产指示书款尺码数据访问对象。
 *
 * @author 吴旭
 */
@Repository("ProductionInstructionLinesSuitStyleNoRepository")
public class ProductionInstructionLinesSuitStyleNoRepositoryImpl extends GenericRepositoryImpl<ProductionInstructionLinesSuitStyleNoEntity, String>
        implements ProductionInstructionLinesSuitStyleNoRepository {

    private final String namespace = "cn.com.huzo.repository.trade.ProductionInstructionLinesSuitStyleNoRepository";

    /**
     * 构造函数,设置the instance to ProductRepositoryImpl.class.
     */
    public ProductionInstructionLinesSuitStyleNoRepositoryImpl() {
        super(ProductionInstructionLinesSuitStyleNoEntity.class);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public List<ProductionInstructionLinesSuitStyleNoEntity> fetchByHeaderId(Long headerId) {
        return getSqlSession().selectList(MyBatisDaoUtils.getMapperQueryId(
                namespace, "fetchByHeaderId"), headerId);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Map<String, Object> fetchSuitStyleNoByHeaderId(Long headerId) {
        return getSqlSession().selectOne(MyBatisDaoUtils.getMapperQueryId(
                namespace, "fetchSuitStyleNoByHeaderId"), headerId);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Integer batchInsert(List<ProductionInstructionLinesSuitStyleNoEntity> itemsList) {
        return getSqlSession().insert(MyBatisDaoUtils.getMapperQueryId(
                namespace, "batchInsert"), itemsList);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Integer batchUpdate(List<ProductionInstructionLinesSuitStyleNoEntity> itemsList) {
        return getSqlSession().update(MyBatisDaoUtils.getMapperQueryId(
                namespace, "batchUpdate"), itemsList);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Integer delete(String linesId) {
        return getSqlSession().delete(MyBatisDaoUtils.getMapperQueryId(
                namespace, "delete"), linesId);
    }
}
